﻿@model GitCandy.Models.TeamModel

@{
    ViewBag.Title = string.Format(SR.Shared_TitleFormat, string.Format(SR.Team_EditTitle, Model.Name));
    var token = GitCandy.Security.Token.Current;
}

<h4>@string.Format(SR.Team_EditTitle, Model.Name)</h4>

<div class="span8">
    @using (Html.BeginForm("Edit", "Team", FormMethod.Post, new { @class = "form-horizontal" }))
    {
        <div class="row">
            <div class="span3 text-right lead muted">@Html.DisplayNameFor(s => s.Name)</div>
            <span class="span1"></span>
            <span class="span5 text-left lead">@Model.Name</span>
            @Html.HiddenFor(s => s.Name, new { @class = "span4 text-left lead" })
        </div>

        <div class="row">
            @Html.LabelFor(s => s.Description, new { @class = "span3 text-right lead muted" })
            <span class="span1"></span>
            @Html.TextAreaFor(s => s.Description, 4, 0, new { @class = "span4 text-left lead" })
        </div>
        <div class="row">
            <span class="text-error span5 offset4">
                @Html.ValidationMessageFor(s => s.Description)
            </span>
        </div>

        @Html.ValidationSummary(true, SR.Team_UpdateUnsuccessfull, new { @class = "alert alert-error" })

        <div class="form-actions">
            <div class="pull-left">
                @Html.ActionLink(SR.Shared_Back, "Detail", new { Model.Name }, new { @class = "btn" })
            </div>
            <div class="pull-right">
                @if (token.IsSystemAdministrator)
                {
                    @Html.ActionLink(SR.Shared_Delete, "Delete", new { Model.Name }, new { @class = "btn" })
                }
                <button type="reset" class="btn btn-inverse">@SR.Shared_Reset</button>
                <button type="submit" class="btn btn-primary">@SR.Shared_Save</button>
            </div>
        </div>
    }
</div>
